<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Defines abstract class for analyser based hint.
 *
 * Analyzing logical expression that work with 2d array "arr" and two indexes "i" and "j".
 *
 * @package     cppexpression
 * @author      Sychev Oleg
 * @copyright   &copy; 2014 Oleg Sychev, Volgograd State Technical University
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
namespace qtype_cppexpression\array2d;
defined('MOODLE_INTERNAL') || die();

class array2d_hint extends  \qtype_cppexpression\hint_from_analyzer {
    // TODO - Pham Quoc Day - write contents.

    /**
     * Check the correct expression
     *
     * @param $expression string expression (of teacher or student).
     * @return $result array of errors
     */
    public static function accept_expression($expression) {
        
        $result = array();
        
        try
        {
            $treeOfTeacher = new qtype_cppexpression_create_tree($answer);
        }
        catch(Exception $e)
        {
            $result[0] = $e->getMessage();
        }

        return $result;
    }
    
    /**
     * Hint analyzer class names should be qtype_cppexpression\name()_hint .
     */
    public function name()
    {
		return 'array2d_hint';
    }


    public function render_hint($renderer, question_attempt $qa = null, question_display_options $options = null, $response = null)
    {

    }
}